package cn.net.mugui.net.pc.message;

import com.mugui.Mugui;
import com.mugui.base.base.Autowired;
import com.mugui.base.base.Component;
import com.mugui.base.client.net.base.Module;
import com.mugui.base.client.net.bean.Message;
import com.mugui.base.client.net.bean.NetBag;

import cn.net.mugui.net.p2p.ServerAttr;
import cn.net.mugui.net.p2p.ServerManager;
import cn.net.mugui.net.pc.panel.ChatPanel;

/**
 * ping消息处理
 * 
 * @author 33
 *
 */
@Module(name = "ping", type = "method")
@Component
public class PingMsg implements Mugui {

	@Autowired
	ChatPanel chatPanel;
	
	public Message add(NetBag bag) {
		ServerAttr serverAttr = manager.get(bag.getSession());
		chatPanel.addUserView(serverAttr);
		return Message.ok();
	}
	@Autowired
	private ServerManager manager;
	public Message update(NetBag bag) {
//		ServerAttr serverAttr = manager.get(bag.getSession());
//		chatPanel.addUserView(serverAttr);
		
		return Message.ok();
	}
}
